package com.aaa.mbs.controller;

import com.aaa.common.util.Result;
import com.aaa.mbs.service.CouponHistoryService;
import com.aaa.mbs.vo.MemberCouponHistory;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: 10178
 * @Date: 2021/1/24 16:44
 * @Description:
 */
@RestController
@RequestMapping("/couponHistory")
public class CouponHistoryController {
    @Autowired
    private CouponHistoryService couponHistoryService;

    @PostMapping("/query")
    public Result<PageInfo<MemberCouponHistory>> selectAll(@RequestParam("pageNo") Integer pageNo,
                                                           @RequestParam("pageSize") Integer pageSize,
                                                           @RequestBody MemberCouponHistory memberCouponHistory
    ) {
        return couponHistoryService.selectAll(pageNo, pageSize, memberCouponHistory.getCouponName(), memberCouponHistory.getMemberName());
    }
}
